package org.test.xmlSax;

import java.io.IOException;
import java.io.StringReader;

import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.junit.Test;

public class JdomXmlAPI {

	
	@Test
	public void test() throws JDOMException, IOException{
		String proMsg = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Result><SmsFlowID>201306251330255509</SmsFlowID><TephoneNo>13765382569</TephoneNo><SmsacakkedNumber>10086</SmsacakkedNumber><ResultType>2</ResultType ><ResultCMDID></ResultCMDID><ResultMessage><(￡></ResultMessage></Result>";
//		String proMsg = "<?xml version=\"1.0\" encoding=\"utf-8\"?><alipay><is_success>T</is_success><request><param name=\"_input_charset\">utf-8</param><param name=\"service\">single_trade_query</param><param name=\"partner\">2088101568349711</param><param name=\"out_trade_no\">20130608174820000539</param></request><response><trade><body>商品描述01</body><buyer_email>441424b01u7.cdb@sina.cn</buyer_email><buyer_id>2088702662625488</buyer_id><discount>0.00</discount><flag_trade_locked>0</flag_trade_locked><gmt_create>2013-06-08 17:48:23</gmt_create><gmt_last_modified_time>2013-06-08 17:52:44</gmt_last_modified_time><gmt_payment>2013-06-08 17:52:44</gmt_payment><is_total_fee_adjust>F</is_total_fee_adjust><operator_role>B</operator_role><out_trade_no>20130608174820000539</out_trade_no><payment_type>1</payment_type><price>0.01</price><quantity>1</quantity><seller_email>alipay-test05@alipay.com</seller_email><seller_id>2088101568349711</seller_id><subject>测试商品01</subject><to_buyer_fee>0.00</to_buyer_fee><to_seller_fee>0.01</to_seller_fee><total_fee>0.01</total_fee><trade_no>2013060818296548</trade_no><trade_status>TRADE_SUCCESS</trade_status><use_coupon>F</use_coupon></trade></response><sign>3128995637ae440bc8a0bb1049a7caa4</sign><sign_type>MD5</sign_type></alipay>";
		Document doc = null;
		SAXBuilder builder = new SAXBuilder();
		doc = builder.build(new StringReader(proMsg));
		Element rootElement = doc.getRootElement();
	}
}
